package day10.Map;

/*
 * Author: JacksonCoder
 * FileName: TreeMapDemo
 * Version: 1.0.0
 * Date: 2025/4/17
 */

import java.util.TreeMap;

public class TreeMapDemo {

    public static void main(String[] args) {
        TreeMap<String, Integer> map = new TreeMap<>();

        map.put("C++", 3);
        map.put("Java", 1);
        map.put("Python", 2);

        for (String key : map.keySet()) {
            System.out.println(key + " = " + map.get(key));
        }
        // 输出顺序：C++, Java, Python（按 key 升序）
    }

}
